package com.songlanyun.modules.schedule;

import com.songlanyun.modules.disabilityauth.service.DisabilityAuthService;
import com.songlanyun.modules.freebaggive.service.FreeBagGiveService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 定时任务
 * <p>
 *
 */
@Component
@Configuration
@EnableScheduling
@Lazy(false)
@Slf4j
public class FreeBagGiveScheduleServiceImpl {

    @Autowired
    private DisabilityAuthService disabilityAuthService;

    @Autowired
    private FreeBagGiveService freeBagGiveService;
    /**
     *
     */
//    @Async
//    @Scheduled(cron = "${task1d0h10m}")
    public void freeBagGiveTask() {
        disabilityAuthService.batchProcess(200,(data)->{
            freeBagGiveService.batchProcess(data.getData());
        });
    }


}
